package com.zh.mediaservice.mapper;

import com.zh.mediapojo.entity.Doctor;
import com.zh.mediapojo.entity.DoctorReserve;
import com.zh.mediapojo.entity.InitDoctorAccount;
import com.zh.mediapojo.vo.ChatDoctorVO;
import com.zh.mediapojo.vo.DoctorVO;
import com.zh.mediapojo.vo.ReserveVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DoctorMapper {
    @Select("select * from doctor where sid=#{sid}")
    List<Doctor> getDoctorBySid(Integer sid);
    @Select("select did from doctor; ")
    List<Integer> getDoctorId();

    @Update("update doctor set am_num=#{amNum},pm_num=#{pmNum} where did=#{id}")
    void updateNum(@Param("id") Integer did, @Param("amNum") Integer amNum, @Param("pmNum") Integer pmNum);

    @Select("select did as doctorId,am_num as nowAmNum,pm_num as nowPmNum from doctor where did=#{doctorId}")
    ReserveVO getReserveNum(Integer doctorId);

    List<Doctor> selectDoctorBySid(List<Integer> departmentIds);

    List<DoctorVO> selectDoctorByDepartmentName(List<String> departmentList);

    List<ChatDoctorVO> getChatDoctor(List<Long> dids);


    List<InitDoctorAccount> getDoctorAccount();
}
